package com.wsq.retrofitdemo.model.request;

import com.wsq.retrofitdemo.utils.Constants;
import com.wsq.retrofitdemo.utils.GenerateSign;

import java.util.HashMap;
import java.util.Map;

/**
 * Date:2021/9/2
 * Time:16:00
 * author:wushengqi
 *
 * task_id String 1-32 是 训练任务 ID
 * third_user_id String 1-32 是 用户 ID
 * text_id String 1-32 是 训练样例文本ID
 * text_seg_id String 1-32 是 训练样例文本段落 ID
 * text_seg_text String 1-256 是 训练样例文本段落内容
 * audio_url String 1-1024 是 音频上传后的
 */
public class IFlyAudioAddReq extends IFlyBase{
    public String task_id;
    public String third_user_id;
    public String text_id;
    public String text_seg_id;
    public String text_seg_text;
    public String audio_url;


    @Override
    public String sign() {
        Map<String, String> map = new HashMap<>();
        map.put("third_user_id",third_user_id);
        map.put("task_id",task_id+"");
        map.put("text_id",text_id);
        map.put("text_seg_id",text_seg_id+"");
        map.put("text_seg_text",text_seg_text);
        map.put("audio_url",audio_url);
        map.put("clientType",clientType+"");
        try {
            return sign = GenerateSign.generateSign(openid, Constants.OPEN_KEY, "", map);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }

    @Override
    public Map<String, String> getMap() {
        Map<String, String> map = new HashMap<>();
        map.put("third_user_id",third_user_id);
        map.put("task_id",task_id+"");
        map.put("text_id",text_id);
        map.put("text_seg_id",text_seg_id+"");
        map.put("text_seg_text",text_seg_text);
        map.put("audio_url",audio_url);
        map.put("clientType",clientType+"");
        map.put("sign",sign);
        map.put("openid",openid);
        return map;
    }
}
